<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePaymentChannelFztwxTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('payment_channel_fztwx', function (Blueprint $table) {
            $table->id();
            $table->char('plat_order_no', 32)->unique()->comment('平台支付号');
            $table->tinyInteger('order_type')->comment('支付订单类型; 1:预付货款充值订单 2:支付订单');
            $table->unsignedBigInteger('trans_amt')->default(0)->comment('订单总金额 单位分');
            $table->char('prepay_id', 64)->default('')->comment('预支付交易会话 ID');
            $table->json('place_order_response_snapshot')->nullable()->comment('下单返回数据快照');
            $table->json('notify_snapshot')->nullable()->comment('回调通知数据快照');
            $table->tinyInteger('status')->default(1)->comment('交易状态 1:下单 2:成功 3:取消 4:失败');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('payment_channel_fztwx');
    }
}
